/*
 * @Author: shanghongyun 2879455630@qq.com
 * @Date: 2025-06-05 15:40:07
 * @LastEditors: shanghongyun 2879455630@qq.com
 * @LastEditTime: 2025-06-05 16:40:00
 * @FilePath: \A05\Dev\PGA.c
 * @Description: 运放配置源文件
 */
#include "dev.h"



/**
 * @description: pga配置
 * @return {*}
 */
void PGA_config(void){
    /* Reset Module */
    SYS_ResetModule(PGA_RST);

    //设置PGA输入 Set GPB multi-function pins for PGA_I GPB3 */
    SYS->GPB_MFP = (SYS->GPB_MFP & ~(SYS_GPB_MFP_PB3MFP_Msk));
    SYS->GPB_MFP|= SYS_GPB_MFP_PB3_PGA_I;
    // The analog input port pins must be configured as input type before the PGA function is enabled.
    GPIO_SetMode(PB, BIT3, GPIO_MODE_INPUT);
    GPIO_DISABLE_DIGITAL_PATH(PB, BIT3);

    /* Set GPC multi-function pins for PGA_O GPC3 */
    // SYS->GPC_MFP = (SYS->GPC_MFP & ~(SYS_GPC_MFP_PC3MFP_Msk));

    /* Enable PGA and setting Gain 关闭PC3 PGA_OUT*/
    PGA_Open(PGA, PGA_GAIN_13, 0);
}

